package com.common.model;

import java.util.List;

import com.github.pagehelper.Page;

import lombok.Data;

/**
 * 分页Model
 * 
 * @author Stone
 *
 * @param <T>
 */
@Data
public class PageModel<T> {
	private Integer draw;
	private Integer start;
	private Integer length;
	private Integer recordsTotal;
	private Integer recordsFiltered;
	private List<T> data;
	
	public void initData(Page<T> page) {
		this.data = page.getResult();
		this.recordsTotal = new Long(page.getTotal()).intValue();
		this.recordsFiltered = this.recordsTotal;
	}

}
